INCLUDES="-I$(PWD)/xmlrpc/include"
LDPATH="$(PWD)/xmlrpc/lib"
all: client1.c server.c client.c
	@cd xmlrpc-c-1.16.40  && ./configure --prefix=$(PWD)/xmlrpc && make && make install && cd ..
	@gcc -c $(INCLUDES) client.c && gcc -o clientsync client.o $(LDPATH)/libxmlrpc_client.a $(LDPATH)/libxmlrpc.a $(LDPATH)/libxmlrpc_util.a $(LDPATH)/libxmlrpc_xmlparse.a $(LDPATH)/libxmlrpc_xmltok.a -L/usr/kerberos/lib64 -lcurl -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lssl -lcrypto -lz
	@gcc -c $(INCLUDES) server.c && gcc -o server server.o $(LDPATH)/libxmlrpc_server_abyss.a $(LDPATH)/libxmlrpc_server.a $(LDPATH)/libxmlrpc_abyss.a -lpthread $(LDPATH)/libxmlrpc.a $(LDPATH)/libxmlrpc_util.a $(LDPATH)/libxmlrpc_xmlparse.a $(LDPATH)/libxmlrpc_xmltok.a -L/usr/kerberos/lib64 -lcurl -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lssl -lcrypto -lz
	@gcc -c $(INCLUDES) client1.c && gcc -o clientasync client1.o $(LDPATH)/libxmlrpc_client.a $(LDPATH)/libxmlrpc.a $(LDPATH)/libxmlrpc_util.a $(LDPATH)/libxmlrpc_xmlparse.a $(LDPATH)/libxmlrpc_xmltok.a -L/usr/kerberos/lib64 -lcurl -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lssl -lcrypto -lz
	@cp clientsync bin && cp clientasync bin && cp server bin
	
.PHONY : clean

clean:
	@rm -rf *.o
	@rm -rf ./bin/clientasync
	@rm -rf ./bin/clientsync
	@rm -rf ./bin/server
